﻿using ManYan.Application;
using ManYan.Common;
using ManYan.Domain.Model.Entity;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace ManYan.Api.Controllers
{
    /// <summary>
    /// Nav控制器，继承BaseController的CURD
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class NavController : BaseController<tb_system_nav,tb_system_nav>
    {
        private readonly INavAppService _navAppServic;
        public NavController(IBaseAppService<tb_system_nav> baseAppService, IHttpContextAccessor httpContextAccessor, INavAppService navAppServic) : base(baseAppService, httpContextAccessor)
        {
            _navAppServic = navAppServic;
        }
        /// <summary>
        /// 获取所有导航数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [AllowAnonymous]
        public Res GetNavData()
        {
            return _navAppServic.GetNavData();
        }
      
    }
}
